package com.huangsm.concurrence.countdown;

import lombok.AllArgsConstructor;

/**
 * @author huang
 * @PACKAGE_NAME com.huangsm.concurrence.countdown
 * @PROJECT_NAME concurrence
 * @date 2019/2/14
 */
@AllArgsConstructor
public class Decrementer implements Runnable {
    java.util.concurrent.CountDownLatch latch  = null;


    @Override
    public void run() {

        try {
            Thread.sleep(1000);
            this.latch.countDown();

            Thread.sleep(1000);
            this.latch.countDown();

            Thread.sleep(1000);
            this.latch.countDown();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
